package com.itheima.demo;

import com.itheima.demo01.Ticket;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author Zhang_Han
 * @version 1.0
 * @date 2020/7/11 19:20
 */
public class Demo_Thread004 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
         Ticket t = new Ticket();
         FutureTask ft = new FutureTask(t);
         Thread t1 = new Thread(ft);
         Thread t2 = new Thread(ft);
         Thread t3 = new Thread(ft);

         t1.setName("窗口一:");
         t2.setName("窗口二:");
         t3.setName("窗口三:");

         t1.start();
         t2.start();
         t3.start();
         Object o = ft.get();
         System.out.println(o);


    }
}
